<%--
  Created by IntelliJ IDEA.
  User: 甘汝雷
  Date: 2017/5/2
  Time: 14:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--解析表达式--%>
<%@ page isELIgnored="false" %>
<%--引入jstl--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--引入springMVC form--%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="page" uri="/xianzhiOA/pageTag" %>
<%@ taglib prefix="p" uri="/xianzhiOA/powerTag" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>工作量分布一览</title>
    <script type="application/javascript">
        function edit() {
            document.getElementById("workingForm").action = "${pageContext.request.contextPath}/Working/workingEdit.emp";
            document.getElementById("workingId").value = null;
            document.getElementById("workingForm").submit();
        }
        function pToSub(page) {
            if(page!=undefined){
                var pageInp = document.getElementById("page");
                pageInp.value = page;
                var form = document.getElementById("workingForm");
                form.submit();
            }
        }
        function deleteCheck(id) {
            if (confirm("确定要删除吗")) {
                window.location.href = "${pageContext.request.contextPath}/Working/deleteWorking.emp?workingId="+id;
            }
        }
    </script>
</head>
<body>
<!--头部开始-->
<jsp:include page="headerBack.jsp"></jsp:include>
<!-- 导航 -->
<jsp:include page="leftBack.jsp"></jsp:include>
<div class="main">
    <!--内容页头部-->
    <div class="page-header">
        <div class="pull-left">
            <ol class="breadcrumb visible-sm visible-md visible-lg">
                <li><a href="${pageContext.request.contextPath}/Login/goHomePage"><i class="icon fa fa-home"></i>主页</a></li>
                <li class="active"><i class="fa fa-pencil"></i>基本信息</li>
            </ol>
        </div>
        <div class="pull-right">
            <h2>主页</h2>
        </div>
    </div>
    <sf:form id="workingForm" action="${pageContext.request.contextPath}/Working/selWorkingAll.emp" modelAttribute="working" method="post" class="search1">
        <div style="height: 40px">
            <p:power jspPower="工作量分布：添加">
                <button onclick="edit()" type="button" class="three btn btn-primary">添加</button>
            </p:power>
            <a href="${pageContext.request.contextPath}/Working/selWorkingAll.emp" class="three btn btn-primary">重置</a></div>
        <input type="hidden" id="page" name="page" value="${page}"/>
        <input type="hidden" id="pages" name='pages' value="${pages}"/>
        <sf:input path="workingId" type="hidden"/>
        <sf:input style="width: 160px" path="project.projectName" type="text" placeholder="按归属项目查询..."/>
        <input style="width: 160px" name="workingWeekCodes" <c:if test="${working.workingWeekCodes!=0}">value="${working.workingWeekCodes}" </c:if>
               type="text" placeholder="周代码行数<该值..." size="10" oninput="if (! /^\d+$/ig.test(this.value)){this.value='';}"/>
        <button type="submit" class="one"><span class="fa fa-search"></span></button>
    </sf:form>
    <c:if test="${workingList.isEmpty()}"><h3 style="text-align: center">工作量分布信息不存在</h3></c:if>
    <c:if test="${!workingList.isEmpty()}">
        <div class="well">
            <table class="table" id="now">
                <thead>
                <tr>
                    <th class="vv">归属项目</th>
                    <th class="vvv">所在周期</th>
                    <th class="vv">计划比例</th>
                    <th class="vv">实际比例</th>
                    <th class="vv">计划工作量</th>
                    <th class="vv">实际工作量</th>
                    <th class="vv">周代码行数</th>
                    <th class="vv">偏差率</th>
                    <th class="vvv">创建日期</th>
                    <p:power jspPower="工作量分布：删除">
                    <th class="vv">删除</th>
                    </p:power>
                    <p:power jspPower="工作量分布：修改">
                    <th class="vv">修改</th>
                    </p:power>
                    <p:power jspPower="工作量分布：详情">
                    <th class="vv">详情</th>
                    </p:power>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${workingList}" var="w">
                    <tr>
                        <td>${w.project.projectName}</td>
                        <td>${w.workingTimeBegin}<br/>${w.workingTimeEnd}</td>
                        <td>${w.workingPlansc}%</td>
                        <td>${w.workingActualsc}%</td>
                        <td>${w.workingPlan}小时</td>
                        <td>${w.workingActual}小时</td>
                        <td>${w.workingWeekCodes}行</td>
                        <td>${w.bias}%</td>
                        <td><fmt:formatDate value="${w.createTime}" pattern="yyyy-MM-dd"/></td>
                        <p:power jspPower="工作量分布：删除">
                            <td>
                                <a onclick="deleteCheck(${w.workingId})" role="button" data-toggle="modal"><i class="fa fa-times"></i></a>
                            </td>
                        </p:power>
                        <p:power jspPower="工作量分布：修改">
                            <td>
                                <a href="${pageContext.request.contextPath}/Working/workingEdit.emp?workingId=${w.workingId}"><i class="fa fa-pencil"></i></a>
                            </td>
                        </p:power>
                        <p:power jspPower="工作量分布：详情">
                            <td>
                                <a href="${pageContext.request.contextPath}/Working/selById.emp?workingId=${w.workingId}"><i class="fa fa-flag"></i></a>
                            </td>
                        </p:power>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
        <c:if test="${pages > 1}">
            <div style="float: right">
                <ul class="pagination">
                    <page:paging length="10" page="${page}" pages="${pages}"/>
                </ul>
            </div>
        </c:if>
    </c:if>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/dist/backEnd/js/datetime.js"></script>
</body>
</html>
